package com.lantosec.hmrp.modules.system.vo;

import java.util.Date;

import com.lantosec.hmrp.modules.system.entity.SysLog;
import com.lantosec.hmrp.core.mvc.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 系统日志表 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-07-03
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="SysLog对象", description="系统日志表")
public class SysLogVO extends BaseVO<SysLog> {
    private static final long serialVersionUID = 1L;


    public SysLogVO(SysLog entity){
        this.id = entity.getId();
        this.userId = entity.getUserId();
        this.logName = entity.getLogName();
        this.logType = entity.getLogType();
        this.uri = entity.getUri();
        this.url = entity.getUrl();
        this.httpMethod = entity.getHttpMethod();
        this.ip = entity.getIp();
        this.parameter = entity.getParameter();
        this.result = entity.getResult();
        this.classMethod = entity.getClassMethod();
        this.userAgent = entity.getUserAgent();
        this.createTime = entity.getCreateTime();
    }

    @Override
    public SysLog convertToEntity(){
        return new SysLog(this);
    }


    @ApiModelProperty(value = "ID")
    private String id;

    @ApiModelProperty(value = "用户Id")
    private String userId;

    @ApiModelProperty(value = "接口的名称")
    private String logName;

    @ApiModelProperty(value = "日志类型")
    private String logType;

    @ApiModelProperty(value = "uri")
    private String uri;

    @ApiModelProperty(value = "url")
    private String url;

    @ApiModelProperty(value = "请求方式")
    private String httpMethod;

    @ApiModelProperty(value = "请求IP")
    private String ip;

    @ApiModelProperty(value = "参数")
    private String parameter;

    @ApiModelProperty(value = "方法结果")
    private String result;

    @ApiModelProperty(value = "请求类和方法")
    private String classMethod;

    @ApiModelProperty(value = "用户代理")
    private String userAgent;

    @ApiModelProperty(value = "执行花费时间")
    private Long takeTime;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;




    @ApiModelProperty(value = "用户名")
    private String userName;

    @ApiModelProperty(value = "开始时间")
    private String startTime;

    @ApiModelProperty(value = "结束时间")
    private String endTime;
}
